home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Code Resources / Jims CDEFs 1.50 / CDEF Source / source / cdefSlider.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.8 KB  |  64 lines  |  [TEXT/KAHL]

  1. //------------------------- © 1995 by James G. Stout -------------------------------
  2. //    File    : cdefSlider.h
  3. //    Date    : April 8, 1995
  4. //    Author    : Jim Stout
  5. //    Purpose    : A slider CDEF
  6. //            :
  7. //            : If you find a use for this, I'd love to know about it.  Bug reports
  8. //            : are always interesting.
  9. //            :
  10. //            : Internet    : JimS@WRQ.COM(work hours, PST)
  11. //            : AppleLink   : WRQ            (daily)
  12. //            : CompuServe  : 73240,2052    (weekly or so)
  13. //            : AOL         : JasG        (weekly or so)
  14. //            : eWorld      : Jim Stout    (weekly or so)
  15. //----------------------------------------------------------------------------------
  16.  
  17. //----------------------------------------------------------------------------------
  18. // variation codes
  19. //----------------------------------------------------------------------------------
  20.  
  21. #define    narrowScale        0x0001    // inset 2 pixels along each edge, thumb is 4 larger
  22. #define narrowScale2    0x0002    // inset 4 pixels along each edge, thumb is 8 larger
  23. #define filledScale        0x0004    // low end of scale filled with cTingeDark
  24. #define snapToScale        0x0008    // click on scale moves thumb to that point
  25.  
  26. //----------------------------------------------------------------------------------
  27. // partCodes returned to actionProc
  28. //----------------------------------------------------------------------------------
  29. #define inThumb        0x0001
  30. #define    inUpScale    0x0002
  31. #define    inDnScale    0x0003
  32.  
  33. //----------------------------------------------------------------------------------
  34. // CDEF private data structure    
  35. //----------------------------------------------------------------------------------
  36.  
  37. typedef struct {
  38. CGrafPtr    offPort;
  39. short        qdVers;
  40. }CDEFData,**CDEFHandle;
  41.  
  42. //----------------------------------------------------------------------------------
  43. //    Function prototypes
  44. //----------------------------------------------------------------------------------
  45. static void doInit            (ControlHandle theCtl);
  46. static void doDisp            (ControlHandle theCtl);
  47. static long doTest            (ControlHandle theCtl, short varCode, long param);
  48.  
  49. static void doDraw            (ControlHandle cHdl, short varCode);
  50. pascal void drawControl     (short depth, short dFlags, GDHandle theDevice, long userData);
  51.  
  52.  
  53. static void dragThumb        (ControlHandle theCtl, short varCode, long param);
  54. static void scaleClick        (ControlHandle theCtl, short varCode, short partCode, Point p);
  55. static void getThumbRect    (ControlHandle theCtl, Rect * rThumb, 
  56.                                 Rect * rScale, Boolean vert);
  57. static short getThumbOffset    (ControlHandle theCtl, Boolean vert, short thumbSize);
  58. static void  checkLimits    (Boolean vert, Rect *rThumb, Rect *rScale);
  59. static short getNewValue    (ControlHandle theCtl, Boolean vert, short thumbPos);
  60. static void adjustControl    (ControlHandle theCtl, short varCode,
  61.                                 short partCode, short newVal);
  62. static Boolean    drawParts    (ControlHandle theCtl, short varCode, Boolean inColor, 
  63.                                 Rect * offRect);
  64.